---
title: "Balancing algorithm report"
output:
  html_document:
    df_print: paged
editor_options:
  chunk_output_type: console
---

```{r,message=FALSE,echo=FALSE}
library(dplyr)
```

```{r,echo=FALSE}
# Supply a "MyData.csv" to the directory,
# where column 1 of csv is the ID
clean <- read.csv("czech_clean.csv")
MyData=clean
MyData=select(MyData,Record.ID,joint,pol,sex,vot)
#MyData=sample_n(MyData,5000)
write.csv(MyData,"MyData.csv",row.names = F)
MyData <- read.csv("MyData.csv")
```

# Python (config = code) 
```{python engine.path="/usr/bin/python3.5",results='hide'}
import sys
sys.path.append('/home/shared/data/balancing/')
import drop
config = "{1: {'degreeHigh':7.5,'noDegreeHigh':42.1,'degreeLow':14.5,'noDegreeLow':35.9}},{2: {'interest':26.8,'LowInterest':73.2}},{3: {'Male':50.3,'Female':49.7}},{4: {'ANO2011':14.06,'TOP09':13.90,'CSSD':12.35,'KSCM':9.57,'KDU_CSL':8.67,'ODS':6.69,'Svob':4.58,'Pir':4.17,'SZ':3.29,'Usvit':2.72,'Undec':20.00}}"


filename = '/home/fernando/Misc/bjpolFinal/Czech/MyData.csv'

drop.run(config, filename, "/home/fernando/Misc/bjpolFinal/Czech/myBal", 2.5)
```

